package com.market.controller.admin;

import com.market.bean.common.BaseStatVo;
import com.market.bean.common.BaseRespVo;
import com.market.bean.vo.admin.AdminStatGoodsVo;
import com.market.bean.vo.admin.AdminStatOrderVo;
import com.market.bean.vo.admin.AdminStatUserVo;
import com.market.service.admin.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fan
 * @Description:
 * @since 2022/12/30 15:24
 */
@RestController
@RequestMapping("admin/stat")
public class AdminStatController {
    @Autowired
    AdminStatService statService;

    @GetMapping("user")
    public BaseRespVo user() {
        BaseStatVo<AdminStatUserVo> data = statService.user();
        return BaseRespVo.ok(data);
    }

    @GetMapping("order")
    public BaseRespVo order() {
        BaseStatVo<AdminStatOrderVo> data = statService.order();
        return BaseRespVo.ok(data);
    }

    @GetMapping("goods")
    public BaseRespVo goods() {
        BaseStatVo<AdminStatGoodsVo> data = statService.goods();
        return BaseRespVo.ok(data);
    }
}
